package com.itheima.service.impl;

import com.itheima.bean.User;
import com.itheima.mapper.UserMapper;
import com.itheima.utils.MapperUtils;

public class UserServiceImpl {
    public User login(User loginUser) {

        try{
            UserMapper mapper = MapperUtils.getMapper(UserMapper.class);
            return mapper.findByUsernameAndPassword(loginUser.getUsername(),loginUser.getPassword());
        }catch(Exception e){
            e.printStackTrace();
        }finally{
            MapperUtils.close();
        }
        return null;
    }
}
